package com.fristvue.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fristvue.dao.GoodsTypeDao;
import com.fristvue.po.GoodsType;
import com.fristvue.po.Util.Page;
import com.fristvue.service.GoodsTypeService;


@Service
@Transactional
public class GoodsTypeServiceImpl implements GoodsTypeService {
	 
	@Autowired
	private GoodsTypeDao goodsTypeDao;
	
	@Override
	public Page<GoodsType> selectGoodsType(Integer num, Integer size, GoodsType goodsType) {
		// TODO Auto-generated method stub
		Page<GoodsType> page = new Page<GoodsType>();
		page.setList(this.goodsTypeDao.selectGoodsType(num, size, goodsType));
		page.setNum(this.goodsTypeDao.countType(goodsType));
		return page;
	}

	@Override
	public boolean insert(GoodsType record) {
		// TODO Auto-generated method stub
		return this.goodsTypeDao.insert(record);
	}

	@Override
	public boolean deleteType(Integer id) {
		// TODO Auto-generated method stub
		return this.goodsTypeDao.deleteType(id);
	}

	@Override
	public GoodsType FindByIdType(Integer id) {
		// TODO Auto-generated method stub
		return this.goodsTypeDao.FindByIdType(id);
	}

	@Override
	public boolean updateById(GoodsType goodsType) {
		// TODO Auto-generated method stub
		return this.goodsTypeDao.updateById(goodsType);
	}

}
